import Vue from 'vue'
import './plugins/axios'
import App from './App.vue'
import router from './router'
import './assets/css/reset.css'
import '@/assets/css/incofont.css'
import LoadAnimate from '@/components/LoadAnimate'
import  'animate.css';
Vue.config.productionTip = false

Vue.filter("formatdate",function(value,formatstr="YYYY年MM月dd日 hh时:mm分:ss秒"){
  let time = new Date(value);
  let obj = {
    "Y+": time.getFullYear(),
    "M+": time.getMonth() + 1,
    "d+": time.getDate(),
    "h+": time.getHours(),
    "m+": time.getMinutes(),
    "s+": time.getSeconds()
  } 
  for(let keyname in obj){
    let reg = new RegExp(keyname,"g")
    if(reg.test(formatstr)){
      formatstr = formatstr.replace(reg,function(res){
        if(res.length === 1){
          return obj[keyname];
        }
        return obj[keyname] >=9 ? obj[keyname]:'0'+ obj[keyname]
      })
    }
  }
  return formatstr
})
//加载组件
Vue.component("LoadAnimate",LoadAnimate)

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
